<?php

namespace app\api\validate;

use think\Validate;
use app\common\Error;

class User extends Validate
{
    protected $rule = [
        'admin_id' => 'require',
        'type'     => 'require',
        'video_id' => 'require',
        'app_id' => 'require',
        'title' => 'require',
        'content' => 'require',
        'subscribe_config' => 'require|array',
    ];

    protected $message  =   [
        'admin_id.require' => Error::ADMIN_ID_NOT_EXIXTS,
        'type.require'     => Error::TYPE_NOT_EXIXTS,
        'video_id.require' => Error::VIDEO_ID_NOT_EXIXTS,
        'app_id.require' => Error::APP_ID_NOT_EXIXTS,
        'title.require' => Error::TITLE_NOT_EXIXTS,
        'content.require' => Error::CONTENT_NOT_EXIXTS,
        'subscribe_config.require' => '订阅消息配置不能为空',
    ];

    protected $scene = [
        'fans_edit' =>  ['admin_id', 'type'],
        'get_user_detail' => ['admin_id', 'video_id'],
        'all_video' => ['admin_id'],
        'is_follow_official_account' => ['video_id'],
        'proposal' => ['app_id', 'title', 'content'],
        'subscribe_config' => ['app_id', 'subscribe_config'],
    ];
}